<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>失业补助金或临时生活补助</title>
	<link rel="stylesheet" href="./styles/web/index.css">
	<link rel="stylesheet" href="./styles/web/print.css" type="text/css" media="print">
	<style>
		.xsnr {
			width: 35% !important;
		}
	</style>
</head>

<body>
	<div class="all">
		<!-- 头部开始 -->
		<script src="http://rsj.beijing.gov.cn/images/rsj_header.js"></script>
		<include src="./include/header.html"></include>
		<!-- 头部结束 -->
		<!-- 申请提示开始 -->
		<div class="message">
			<div class="content clearfix">
				<div class="zuo left">
					<div class="first common" style="padding: 10px;">
						<div class="titles concommon">
							<a href="./index.html">
								< 首页</a> <span class="on">|</span>
									<span>历次申领记录查询</span>
						</div>
						<!-- 申领记录查询开始 -->
						<div class="message_tf">
							<div class="sl_box">
								<div class="totle" id="searchResult">
									<script type="text/html" id="searching">
																<%if(data.executeResult == 1){%>
																		<% var _data = data.lcsljl[0]%>
																		<%if(_data){%>
																<div class="searchcontent clearfix">
																		<div class="titles clearfix">
																				<p class="left shen left">失业补助金或临时生活补助</p>
																				<p class="left enjoy left">人员信息</p>
																		</div>
																		<%if(_data.sqrq){%>
																		<div class="grxx clearfix left">
																				<span class="gr_name left">申领日期 :</span>
																				<span class="gr_one left"><%=_data.sqrq%></span>
																		</div>
																		<%}%>
																		<%if(_data.yslys){%>
																		<div class="grxx clearfix left">
																				<span class="gr_name left" title="">已申领月数 :</span>
																				<span class="gr_one left"><%=_data.yslys%>(月)</span>
																		</div>
																		<%}%>
																		<%if(_data.xsztmc){%>
																		<div class="grxx clearfix left">
																				<span class="gr_name left" title="">享受状态:</span>
																				<span class="gr_one left"><%=_data.xsztmc%></span>
																		</div>
																		<%}%>
																		<%if(_data.btksny && _data.btjsny){%>
																		<div class="grxx clearfix left">
																				<span class="gr_name left" title="">享受起止日期 :</span>
																				<span class="gr_one left"><%=_data.btksny%>-<%=_data.btjsny%></span>
																		</div>
																		<%}%>
																		<%if(_data.btlx){%>
																		<div class="tf_item clearfix">
																				<span class="gr_name left" title="">补贴类型:</span>
																				<span class="gr_one left"><%=_data.btlx%></span>
																		</div>
																		<%}%>
																		<%if(_data.tfyy){%>
																		<div class="tf_item clearfix left">
																				<span class="gr_name left xsnr" title="">停发原因（停发显示）:</span>
																				<span class="gr_one left"><%=_data.tfyy%></span>
																		</div>
																		<%}%>
																		<%if(_data.shbtgyy){%>
																		<div class="tf_item clearfix left">
																				<span class="gr_name left" title="">审核不通过原因（审核不通过显示）:</span>
																				<span class="gr_one left"><%=_data.shbtgyy%></span>
																		</div>
																		<%}%>
																		<div class="clearfix left titles">
																				<p class="takes J_bzbg">领取信息列表</p>
																		</div>
																</div>
																<div class="tables struct J_bz">
																				<table border="0" cellspacing="0" cellpadding="0" class="table">
																						<thead>
																								<tr>
																								<td style="width:20%">补贴年月</td>
																								<td style="width:40%">发放类型</td>
																								<td style="width:20%">发放金额</td>
																								<td style="width:20%">发放状态</td>
																								</tr>
																						</thead>
																						<tbody>
																								<%if(_data.ayslJls){%>
																								<%for(var j=0;j<_data.ayslJls.length;j++){%>
																										<% var _item = _data.ayslJls%>
																										<%var je = _item[j].btje/100%>
																								<tr>
																										<td style="width:20%"><%=_item[j].slny%></td>
																										<td style="width:40%"><%=_item[j].fflb%></td>
																										<td style="width:20%"><%=je%>(元)</td>
																										<%if(_item[j].yhffzt == '1'){%>
																												<td class="dff_sb" style="width:20%;">失败</td>
																										<%}else if(_item[j].yhffzt == '0'){%>
																												<td class="dff_cg" style="width:20%;">成功</td>
																										<%}else if(_item[j].yhffzt == ''){%>
																												<td class="dff_dff" style="width:20%;">待发放</td>
																										<%}%>
																								</tr>
																								<%}%>
																								<%}else{%>
																										<tr>
																												<td colspan='4' style="width:100%">暂无数据</td>
																										</tr>
																								<%}%>
																						</tbody>
																				</table>
																				
																		</div>
																		<div class="tf_btn">
																				<div style="width:100%;" class="clearfix">
																						<div class="tfr_btn hide left J_tfr_btn">
																								<span class='card_left left' style="width:70px">停发原因：</span>
																								<select class='left Jgmc' id="J_tfbtn" style="margin-left:10px"
																										paramete="tfyy" v_require valiflag=",,停发原因,false" value='<%=_data.tfyy%>'>
																								</select>
																						</div>
																						<div class="tfl_btn right" style="text-align:right">
																										<button class="J_tf_btnl disab_btn" id="tf_btnan" sqid="<%=_data.sqid%>" xszt="<%=_data.xszt%>" disabled>停发</button>
																						</div>                                                
																				</div>
																				<div class="bz_btn hide clearfix J_bz_btn">
																						<span class="btn_span left">备注：</span>
																						<textarea class="text_bz left J_bttext" maxlength="128"><%=_data.bz%></textarea>
																				</div>
																		</div>
																<%}%>
																<%}%>
															</script>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="you right">
					<div class="top">
						<div class="person on">
							<p class="on xm"></p>
							<p class="lxdh"></p>
						</div>
						<p class="sfzhm"></p>
					</div>
					<div id="J_tcwrap">
						<script type="text/html" id="J_tcitem">
						<%if(data.executeResult == 1){%>
							<% var _data = data.info%>
							<div class="middle">
								<%if(_data.xsztmc){%>
									<div class="yyxx_box">
										<p class="zjyyxx" style="width: 160px;">
											<span>审核状态：</span>
											<span class="yhzh" title="<%=_data.xsztmc%>"><%=_data.xsztmc%></span>
										</p>
										<a href="#" class="J_jl">历次申领记录查询</a>
									</div>
								<%}else{%>
									<h3 class="">暂无申领记录</h3>     
								<%}%> 
							</div>
							<div class="middle">
								<%if(_data.yhzh){%>
									<div class="yyxx_box clearfix"> 
									 <p class="zjyyxx left" style="width: 176px;">
										 <span>银行账号：</span>
										 <span class="yhzh" title="<%=_data.yhzh%>"><%=_data.yhzh%></span>
									 </p>
									 <button class="right J_yhk" >银行账号变更</button>
								 </div>   
								<%}else{%> 
								 <h3 class="">暂无银行账号信息</h3>  
								<%}%> 
							</div>
					<%}%>
					</script>
					</div>
					<div class="newbox">
						<div class="box_two">
							<p class="zxtel">咨询电话：12333</p>
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- 申请提示结束 -->
		<!-- 尾部开始 -->
		<!-- <include src="./include/footer.html"></include> -->
		<script src="http://rsj.beijing.gov.cn/footer.js"></script>
		<!-- 尾部结束 -->
	</div>

</body>
<script src="./common/js/vendor.js"></script>
<script src="./common/js/jquery.js"></script>
<script src="./common/js/validator.js"></script>
<script src="./common/js/template-native.js"></script>
<script src="./common/common.js"></script>
<script src="./common/js/common.js"></script>
<script src="./common/js/generaltools.js"></script>
<script>
	$(function () {
		var loading = new $.Loading();
		var yhzhbg, tfyy, lastdayoftheM;//停发原因
		var sqid = $.paramObj().sqid;
		getLcyyxc(); //历次预约查询
		getYyhzhCx(); //原银行账户信息查询
		getSqid();

		//历次查询
		function getSqid() {
			var sqid = $.paramObj().sqid;
			var finurl = '/sybxjbz/lcsljlCx' + '/' + sqid
			$.asyncRender({
				url: finurl,
				type: 'get',
				wrap: '#searchResult',
				tem: '#searching',
				pos: 'returnData'
			}).done(function (result) {
				var msg = result.returnData;
				if (msg.executeResult == "1") {
					var tfid, xszt;
					if (msg.lcsljl[0]) {
						$.renderCodeOther('/sybxjsl/dmblbCx', $('#J_tfbtn'), 'sybzj_d_tfyy', msg.lcsljl[0].tfyy);
						tfid = msg.lcsljl[0].tfid; //停发id
						xszt = msg.lcsljl[0].xszt;  //享受状态
						if (tfid == '' && xszt == '03') {
							$('.J_tf_btnl').addClass('tf_btnl');
							$('.J_tf_btnl').removeClass('disab_btn'); //置灰样式
							$("#tf_btnan").removeAttr("disabled");
							$('.J_tfr_btn').show(); //停发原因下拉框
						}
					}
				} else {
					$.layerMsg(msg.message, '确定')
				}
			})
		}

		//原银行账户信息查询
		function getYyhzhCx() {
			$.asyncRender({
				url: '/sybxjbz/yyhzhCx',
				type: 'get',
				async: true,
				wrap: '#J_wrap1',
				tem: '#J_item1',
				pos: 'returnData'
			}).done(function (result) {
				var msg = result.returnData;
				if (msg.executeResult == "1") {
					lastdayoftheM = msg.lastdayoftheM;  //1是 0不是
					yhzhbg = msg.yyhzhxx.yhzh;
					sqid = msg.yyhzhxx.sqid;
				} else {
					$.layerMsg(msg.message, '确定')
				}
			})
		}

		//银行账号变更
		$(document).on('click', '.J_yhk', function () {
			if (lastdayoftheM == '1') {
				$.layerMsg('每月最后一天因资金结算期，银行账号变更功能暂停，请在其他时间进行银行账号变更，谢谢理解和支持。', '确定');
				return false;
			} else if (lastdayoftheM == '0') {
				if (yhzhbg) {
					window.location.href = "./yhkwh.html"
				} else {
					$(this).attr("disabled", true);
				}
			}
		});

		//停发原因
		$(document).on('change', '#J_tfbtn', function () {
			tfyy = $(this).val();
			if (tfyy == '99') {
				$('.J_bz_btn').show();
			} else {
				$('.J_bz_btn').hide();
				$('.J_bttext').val('');
			}
		});

		//停发保存
		$(document).on('click', '.J_tf_btnl', function () {
			var _data = {
				sqid: $(this).attr('sqid'), //申请id
				tfyy: tfyy, //停发原因
				bz: $('.J_bttext').val(), //备注
			}
			if (tfyy == '') {
				$.layerMsg('停发原因不能为空！', '确定');
				return false;
			}
			//停发原因为其他时，添加校验
			if (tfyy == '99') {
				if ($('.J_bttext').val() == '') {
					$.layerMsg('停发备注不能为空！', '确定');
					return false;
					if ($('.J_bttext').val().length > 128) {
						$.layerMsg('停发备注长度不能超过128个字！', '确定');
						return false;
					}
				}
			}
			$.layerMsg("您正在办理停发失业补助金/临时生活补助。失业人员在一次失业期间只可享受一种失业保险待遇，您停发当前失业保险待遇后，在同一失业期间不可再申领其他失业保险待遇。", [
				{
					text: '确认停发',
					cb: function () {
						loading.on();
						$.fetch({
							url: '/sybxjbz/tfSave',
							type: 'post',
							data: _data
						}).done(function (result) {
							if (result.returnData.executeResult === '1') {
								$.layerMsg('保存成功！', '确定', function () {
									window.location.href = './index.html';
								});
							} else {
								$.layerMsg(result.returnData.message, '确定');
							}
						}).always(function () {
							loading.off();
						})
					}
				},
				{ text: '我再想想', }], '', 15)
		});

	})
</script>

</html>